Raw Source
desarrolloforos / [2015] CerealOgameStats

// ==UserScript==
// @name         [2015] CerealOgameStats
// @description  Make alliance stats from ogame to post in forums 
// @namespace    https://github.com/EliasGrande/
// @downloadURL  https://github.com/EliasGrande/CerealOgameStats/raw/master/dist/releases/latest.user.js
// @updateURL    https://github.com/EliasGrande/CerealOgameStats/raw/master/dist/releases/latest.meta.js
// @icon         https://github.com/EliasGrande/CerealOgameStats/raw/master/dist/img/icon.png
// @version      3.1.0
// @include      *://*.ogame.*/game/index.php?*page=alliance*
// ==/UserScript==
/*! CerealOgameStats (C) 2014 Elías Grande Cásedas | MIT | opensource.org/licenses/MIT */
(function(){var f=window,l,d;try{if(unsafeWindow){f=unsafeWindow}}catch(h){}l=f.document;var g=function(p){var o=l.createElement("style");o.setAttribute("type","text/css");if(o.styleSheet){o.styleSheet.cssText=p}else{o.appendChild(l.createTextNode(p))}var e=l.getElementsByTagName("head")[0];e.appendChild(o)};g("#member-list {display:none;}");var b={ready:false,list:l.createElement("table"),wait:10};var m=function(){try{var o=l.getElementById("member-list");if(!o){throw 0}else{b.list.innerHTML=o.innerHTML;b.ready=true;delete b.wait;g("#member-list {display:table;}")}}catch(p){b.wait=Math.round(b.wait*1.1);var q=this;setTimeout(m,b.wait)}};m();var i={name:"CerealOgameStats",home:"https://github.com/EliasGrande/CerealOgameStats/"};String.prototype.replaceAll=function(e,o){return this.split(e).join(o)};String.prototype.recursiveReplaceMap=function(r,q,o){if(o==0){return this.split(r[0]).join(q[0])}var p,e=this.split(r[o]);for(p in e){e[p]=e[p].recursiveReplaceMap(r,q,o-1)}return e.join(q[o])};String.prototype.replaceMap=function(e){var o,r,q,p;r=new Array();q=new Array();p=0;for(o in e){r.push(o);q.push(e[o]);p++}if(p==0){return this}else{return this.recursiveReplaceMap(r,q,p-1)}};String.prototype.trimNaN=function(){return this.replace(/^\D+$/,"").replace(/^\D*(\d)/,"$1").replace(/(\d)\D*$/,"$1")};var a=function(){var v=function(){this.getMeta("version","ogame-version",null);this.getMeta("language","ogame-language","en");this.getMeta("timestamp","ogame-timestamp",null);this.getMeta("universe","ogame-universe",null);this.getMeta("alliance_id","ogame-alliance-id",null);this.getMeta("player_name","ogame-player-name","")};v.prototype={getMeta:function(G,H,I){try{this[G]=l.querySelector('meta[name="'+H+'"]').getAttribute("content")}catch(J){this[G]=I}}};var t=new v();var C={id:function(G){return i.name+"_"+t.universe+"_"+t.alliance_id+"_"+G},set:function(J,G){var H=this.id(J);try{f.localStorage.setItem(H,G)}catch(I){f.localStorage[H]=G}return G},get:function(J){var G=this.id(J);try{return f.localStorage.getItem(G)}catch(H){var I=f.localStorage[G];return(I=="undefined")?null:I}}};var x=function(){this.lc={}};x.prototype={get:function(G){if(this.lc[G]){return this.lc[G]}return G},set:function(H){for(var G in H){this.lc[G]=H[G]}},number:function(L){var K,G,J,H;K=L+"";G=K.split(".");J=G[0];H=G.length>1?this.lc.s_dec+G[1]:"";var I=/(\d+)(\d{3})/;while(I.test(J)){J=J.replace(I,"$1"+this.lc.s_tho+"$2")}return J+H},date:function(G){return G.trimNaN().split(/\D+/).join(this.lc.s_dat)},time:function(G){return G.trimNaN().split(/\D+/).join(this.lc.s_tim)},period:function(M){var H,L,K,G,J=parseInt(M),I="",N=0;H=Math.floor(J/604800);J-=H*604800;L=Math.floor(J/86400);J-=L*86400;K=Math.floor(J/3600);J-=K*3600;G=Math.floor(J/60);J-=G*60;if(H>0){I+=this.number(H)+this.lc.a_wee+" ";N++}if(L>0){I+=this.number(L)+this.lc.a_day+" ";N++}if(K>0||N<1||G+J<1){I+=this.number(K)+this.lc.a_hou+" ";N++}if(G>0||N<2||(N==2&&J<1)){I+=this.number(G)+this.lc.a_min+" ";N++}if(J>0||N<3){I+=this.number(J)+this.lc.a_sec}return I.trim()}};var w=new x();var F=function(G){return w.get(G)};
/*! [i18n=en] */
;w.set({s_dec:".",s_tho:",",s_dat:"/",s_tim:":",a_wee:"w",a_day:"d",a_hou:"h",a_min:"m",a_sec:"s",b_sel:"Select",b_del:"Erase",b_get:"Get from this page",b_sav:'Save as "Old data"',b_loa:"Load saved data",b_res:"Reset stats",t_odt:"Old data",t_ndt:"New data",t_fmt:"Format",t_col:"Colors",t_inc:"Include",t_out:"Statistics (code)",t_stb:"Status",t_pre:"Evolution",t_exp:"Export to forums",p_ago:"{period} ago",p_now:"now",c_dbg:"Dark background",c_lbg:"Light background",e_nod:"No old data",e_nnd:"No new data",e_odf:"The old data has wrong format",e_ndf:"The new data has wrong format",e_unk:"Unexpected error",e_ndt:"No data",e_wft:"Wrong format",w_pcs:"Processing",o_tdt:"Evolution of the alliance since {oldDate} to {newDate}",o_tet:"Elapsed time",o_tas:"Alliance summary",o_ptl:"Total points",o_ppm:"Points per member",o_ttt:"Top 3 by total score",o_tts:"Top 3 by gained score",o_ttp:"Top 3 by gained percent",o_ttg:"Top 3 by gained positions",o_trt:"Total score rank",o_trs:"Gained score rank",o_trp:"Gained percent rank",o_trg:"Gained positions rank",o_tsc:"Special cases",o_cnm:"new member",o_cla:"leaves the alliance",o_bdg:"banned",o_bdq:"unbanned",o_abt:"Statistics performed with {link}",e_oga:"OGame Error, reload this page may fix it"});
/*! [i18n=es] */
;if(/es|ar|mx/.test(t.language)){w.set({s_dec:",",s_tho:".",a_wee:"s",a_day:"d",a_hou:"h",a_min:"m",a_sec:"s",b_sel:"Seleccionar",b_del:"Borrar",b_get:"Obtener de esta página",b_sav:'Guardar como "Datos antiguos"',b_loa:"Cargar datos guardados",b_res:"Resetear estadísticas",t_odt:"Datos antiguos",t_ndt:"Datos nuevos",t_fmt:"Formato",t_col:"Colores",t_inc:"Incluir",t_out:"Estadísticas (código)",t_stb:"Estado",t_pre:"Evolución",t_exp:"Exportar para foros",p_ago:"hace {period}",p_now:"ahora",c_dbg:"Fondo oscuro",c_lbg:"Fondo claro",e_nod:"No hay datos antiguos",e_nnd:"No hay datos nuevos",e_odf:"Los datos antiguos tienen un formato erróneo",e_ndf:"Los datos nuevos tienen un formato erróneo",e_unk:"Error inesperado",e_ndt:"Sin datos",e_wft:"Formato erróneo",w_pcs:"Procesando",o_tdt:"Evolución de la alianza desde el {oldDate} hasta el {newDate}",o_tet:"Tiempo transcurrido",o_tas:"Resumen de la alianza",o_ptl:"Puntos totales",o_ppm:"Puntos por miembro",o_ttt:"Top 3 por puntos totales",o_tts:"Top 3 por puntos subidos",o_ttp:"Top 3 por porcentaje subido",o_ttg:"Top 3 por posiciones subidas",o_trt:"Ranking por puntos totales",o_trs:"Ranking por puntos subidos",o_trp:"Ranking por porcentaje subido",o_trg:"Ranking por posiciones subidas",o_tsc:"Casos especiales",o_cnm:"nuevo miembro",o_cla:"abandona la alianza",o_bdg:"baneado",o_bdq:"desbaneado",o_abt:"Estadísticas realizadas con {link}",e_oga:"Error de OGame, recargar esta página puede arreglarlo"})}
/*! [i18n=fr] by Elvara http://userscripts-mirror.org/topics/116649 */
;if(/fr/.test(t.language)){w.set({s_dec:".",s_tho:",",s_dat:"/",s_tim:":",a_wee:"s",a_day:"j",a_hou:"h",a_min:"m",a_sec:"s",b_sel:"Sélectionner",b_del:"Effacer",b_get:"Recharger de cette page",b_sav:'Sauvegarder comme "Anciennes données"',b_loa:"Charger anciennes données",b_res:"Réinitialiser les statistiques",t_odt:"Anciennes données",t_ndt:"Nouvelles données",t_fmt:"Format",t_col:"Couleur",t_inc:"Inclure",t_out:"Statistiques (code)",t_stb:"Statut",t_pre:"Évolution",t_exp:"Exporter pour forums",p_ago:"{period} depuis le début",p_now:"maintenant",c_dbg:"Arrière plan foncé",c_lbg:"Arrière plan clair",e_nod:"Pas d'anciennes données",e_nnd:"Pas de nouvelles données",e_odf:"Les anciennes données ont un mauvais format",e_ndf:"Les nouvelles données ont un mauvais format",e_unk:"Erreur inattendu",e_ndt:"Pas de données",e_wft:"Mauvais format",w_pcs:"Traitement en cours",o_tdt:"Évolution de l'alliance du {oldDate} au {newDate}",o_tet:"Temps passé",o_tas:"Résumé de l'alliance ",o_ptl:"Points totaux",o_ppm:"Points par membres",o_ttt:"Top 3 par points totaux",o_tts:"Top 3 par points gagnées",o_ttp:"Top 3 par pourcentage gagné",o_ttg:"Top 3 par places gagnées",o_trt:"Rang par points totaux",o_trs:"Rang par points gagnées",o_trp:"Rang par pourcentage gagné",o_trg:"Rang par places gagnées",o_tsc:"Cas spéciaux",o_cnm:"Nouveaux Membres",o_cla:"A quitté l'alliance",o_bdg:"Banni",o_bdq:"Débanni",o_abt:"Statistiques obtenues avec {link}",e_oga:"Erreur OGame, recharger la page peut régler le problème"})}
/*! [i18n=tr] by Joaquin09 http://userscripts-mirror.org/topics/118658 */
;if(/tr/.test(t.language)){w.set({s_dec:".",s_tho:",",s_dat:"/",s_tim:":",a_wee:"h",a_day:"g",a_hou:"s",a_min:"d",a_sec:"s",b_sel:"Seç",b_del:"Sil",b_get:"Bu sayfadankini kullan",b_sav:'"Eski veri" olarak kaydet',b_loa:"Kaydedilen verileri yükle",b_res:"İstatistikleri sıfırla",t_odt:"Eski veri",t_ndt:"Yeni veri",t_fmt:"Biçim",t_col:"Renkler",t_inc:"Ekle",t_out:"İstatistik (code)",t_stb:"Durum",t_pre:"Gelişim",t_exp:"Forumlara Aktar ",p_ago:"{period} önce",p_now:"şimdi",c_dbg:"Koyu arka plan",c_lbg:"Açık arka plan",e_nod:"Eski veri",e_nnd:"Yeni veri yok",e_odf:"Eski veri hatalı formatta",e_ndf:"Yeni veri hatalı formatta",e_unk:"Beklenmeyen hata",e_ndt:"Veri yok",e_wft:"Yanlış format",w_pcs:"İşleniyor",o_tdt:"Gelişim Zaman Aralığı {oldDate} - {newDate} ",o_tet:"Geçen zaman",o_tas:"İttifak Bilgisi",o_ptl:"Toplam Puan",o_ppm:"Üye Başına Ortalama Puan",o_ttt:"Toplam Puana Göre En İyi 3",o_tts:"Puan Artışına Göre En İyi 3",o_ttp:"Yüzdelik Artışa Göre En İyi 3",o_ttg:"Sıra Artışına Göre En İyi 3",o_trt:"Toplam Puana Göre Sıralama",o_trs:"Puan Artışına Göre Sıralama",o_trp:"Yüzdelik Artışa Göre Sıralama",o_trg:"Sıra Artışına Göre Sıralama",o_tsc:"Özel Durumlar",o_cnm:"Yeni Üye",o_cla:"İttifaktan ayrılır",o_bdg:"Yasaklı",o_bdq:"Yasağı kaldırılmış",o_abt:"{link} tarafından gerçekleştirilen istatistikler",e_oga:"OGame Hatası, Düzeltmek İçin Sayfayı Tekrar Yükleyin"})}
/*! [i18n=pt] by wacker faxes http://userscripts-mirror.org/topics/118886 */
;if(/pt|br/.test(t.language)){w.set({s_dec:".",s_tho:",",s_dat:"/",s_tim:":",a_wee:"s",a_day:"d",a_hou:"h",a_min:"m",a_sec:"s",b_sel:"Seleccionar",b_del:"Apagar",b_get:"Obter desta página",b_sav:'Gravar como "Informação antiga"',b_loa:"Carregar informação gravada",b_res:"Recomeçar",t_odt:"Informação antiga",t_ndt:"Informação nova",t_fmt:"Formato",t_col:"Cores",t_inc:"Incluir",t_out:"Estatísticas (código)",t_stb:"Estado",t_pre:"Evolução",t_exp:"Exportar para foruns",p_ago:"{period} atrás",p_now:"agora",c_dbg:"Fundo escuro",c_lbg:"Fundo claro",e_nod:"Sem informação antiga",e_nnd:"Sem informação nova",e_odf:"A informação antiga tem formato errado",e_ndf:"A informação nova tem formato errado",e_unk:"Erro inesperado",e_ndt:"Sem informação",e_wft:"Formato errado",w_pcs:"Processar",o_tdt:"Evolução da aliança desde {oldDate} até {newDate}",o_tet:"Tempo decorrido",o_tas:"Sumario da aliança",o_ptl:"Pontos totais",o_ppm:"Pontos por membro",o_ttt:"Top 3 por pontos totais",o_tts:"Top 3 por pontos ganhos",o_ttp:"Top 3 por percentagem ganha",o_ttg:"Top 3 por posições ganhas",o_trt:"Classificação total de pontos",o_trs:"Classificação pontos ganhos",o_trp:"Classificação percentagem ganha",o_trg:"Classificação posições ganhos",o_tsc:"Casos especiais",o_cnm:"novo membro",o_cla:"deixou aliança",o_bdg:"banido",o_bdq:"ex-banido",o_abt:"Estatísticas realizadas por {link}"})}
/*! [i18n=it] by adyr http://userscripts-mirror.org/topics/119582 */
;if(/it/.test(t.language)){w.set({s_dec:".",s_tho:",",s_dat:"/",s_tim:":",a_wee:"s",a_day:"g",a_hou:"o",a_min:"m",a_sec:"s",b_sel:"Seleziona",b_del:"Cancella",b_get:"Copia dalla pagina",b_sav:'Salva come "Dati vecchi"',b_loa:"Carica dati salvati",b_res:"Resetta le statistiche",t_odt:"Dati vecchi",t_ndt:"Nuovi dati",t_fmt:"Formato",t_col:"Colori",t_inc:"Includi",t_out:"Statistiche (codice)",t_stb:"Status",t_pre:"Progresso",t_exp:"Esporta per il forum",p_ago:"{period} fa",p_now:"ora",c_dbg:"Sfondo scuro",c_lbg:"Sfondo chiaro",e_nod:"Nessun dato vecchio",e_nnd:"Nessun dato nuovo",e_odf:"I dati vecchi hanno un formato sbagliato",e_ndf:"I dati nuovi hanno un formato sbagliato",e_unk:"Errore generico",e_ndt:"Nessu dato",e_wft:"Formato errato",w_pcs:"In elaborazione",o_tdt:"Progresso alleanza da {oldDate} a {newDate}",o_tet:"Tempo trascorso",o_tas:"Sommario alleanza",o_ptl:"Punti totali",o_ppm:"Punti per Player",o_ttt:"Top 3 punteggio totale",o_tts:"Top 3 punti guadagnati",o_ttp:"Top 3 percentuale punti guadagnati",o_ttg:"Top 3 posizioni guadagnate",o_trt:"Classifica punteggio totale",o_trs:"Classifica punti guadagnati",o_trp:"Classifica percentuale punti guadagnati",o_trg:"Classifica posizioni guadagnate",o_tsc:"Casi speciali",o_cnm:"nuovo alleato",o_cla:"ha lasciato l alleanza",o_bdg:"bannato",o_bdq:"sbannato",o_abt:"Statistiche create da {link}",e_oga:"Errore di Ogame, ricarica la pagina"})}
/*! [i18n=ru] by Asiman board.origin.ogame.gameforge.com/board175-u/board39-o/p34454-c#post34454 */
;if(/ru/.test(t.language)){w.set({s_dec:".",s_tho:",",s_dat:"/",s_tim:":",a_wee:"н",a_day:"д",a_hou:"ч",a_min:"м",a_sec:"с",b_sel:"Выделить",b_del:"Очистить",b_get:"Получить с этой страницы",b_sav:'Сохранить "Старые данные"',b_loa:"Загрузить сохраненные данные",b_res:"Обнулить статистику",t_odt:"Старые данные",t_ndt:"Новые данные",t_fmt:"Формат",t_col:"Цвета",t_inc:"Показать/Скрыть",t_out:"Статистика (код)",t_stb:"Статус",t_pre:"Прогресс",t_exp:"Экспорт для форума",p_ago:"{period} с предыдущей даты",p_now:"сейчас",c_dbg:"Темный фон",c_lbg:"Светлый фон",e_nod:"Нет старых данных",e_nnd:"Нет новых данных",e_odf:"Старые данные имеют неверный формат",e_ndf:"Новые данные имеют неверный формат",e_unk:"Неожиданная ошибка",e_ndt:"Нет данных",e_wft:"Неверный формат",w_pcs:"Обработка",o_tdt:"Прогресс альянса с {oldDate} по {newDate}",o_tet:"Прошедшее время",o_tas:"Сумарно по альянсу",o_ptl:"Общее количество очков",o_ppm:"Очки на одного члена",o_ttt:"Топ 3 по общему количеству очков",o_tts:"Топ 3 по полученому количеству очков",o_ttp:"Топ 3 по полученому проценту",o_ttg:"Топ 3 по полученым позициям",o_trt:"Всего количество очей по топу",o_trs:"Приобретено количество очей по топу",o_trp:"Приобретено процентов по топу",o_trg:"Приобретено позиций по топу",o_tsc:"Особые случаи",o_cnm:"новый игрок альянса",o_cla:"покинул альянс",o_bdg:"заблокирован",o_bdq:"разблокирован",o_abt:"Первоисточник статистики: {link}",e_oga:"Ошибка OGame, перезагрузка страници может исправить данную ошибку"})}
/*! [/i18n] */
;var E=function(){this.names=new Array();this.colors=new Array();this.selected=null};E.prototype={add:function(H,G){this.names.push(H);this.colors.push(G)},select:function(G){this.selected=this.colors[G]},replace:function(G){return G.replaceMap(this.selected)}};var u=new E();
/*! [color=dark-background] */
;u.add(F("c_dbg"),{"{nameColor}":"white","{growsColor}":"#00FF40","{decreasesColor}":"#ED7010","{remainsColor}":"#00DDDD"});
/*! [color=light-background] */
;u.add(F("c_lbg"),{"{nameColor}":"purple","{growsColor}":"green","{decreasesColor}":"red","{remainsColor}":"blue"});
/*! [/color] */
;var r={diffScore:function(G,J){var I=J-G;var H=((J/G)-1)*100;return{score:I,percent:H}}};var p=function(){this.formats=new Array();this.selected=null;this.escapeMap={"[":"[[u][/u]","]":"[u][/u]]"};this.lastReplace={"{grows}":"\u00BB","{decreases}":"\u00AB","{remains}":"\u007E","{remainsNo}":"\u00D8","{up}":"\u2191","{down}":"\u2193","{infinity}":"\u8734;","{rank}":"#","{\\":"{","\\}":"}"};this.layout={sectionStart:"[size=big]{title}[/size]",sectionEnd:"\n\n",dateTime:"{date} ([i]{time}[/i])",header:"[b]{title}[/b]\n{elapsedTitle}: {elapsedTime}\n\n",allianceLine:"\n[color={diffColor}]{diff}[/color] [b][color={nameColor}]{title}[/color][/b] - {newScore} ([b][color={diffColor}]{diffScore}[/color][/b]) ([b][color={diffColor}]{diffPercent}[/color][/b] [color={diffColor}][size=small]%[/size][/color])",top3TScoreLine:"\n[color={diffColor}]{position} {diff} [/color] [color={nameColor}][b]{name}[/b][/color] ({newScore})",top3ScoreLine:"\n[color={diffColor}]{position} {diff} [/color] [color={nameColor}][b]{name}[/b][/color] ([b][color={diffColor}]{diffScore}[/color][/b])",top3PercentLine:"\n[color={diffColor}]{position} {diff} [/color] [color={nameColor}][b]{name}[/b][/color] ([b][color={diffColor}]{diffPercent}[/color][/b] [color={diffColor}][size=small]%[/size][/color])",top3PositionsLine:"\n[color={diffColor}]{position} {diff} [/color] [color={nameColor}][b]{name}[/b][/color] ([b][color={diffColor}]{diffPos}[/color][/b])",rankLine:"\n[color={diffColor}]{position} {diff} [/color][color={nameColor}][b]{name}[/b][/color] - {newScore} ([b][color={diffColor}]{diffScore}[/color][/b]) ([b][color={diffColor}]{diffPercent}[/color][/b] [color={diffColor}][size=small]%[/size][/color])",rank:" [size=small]{rank}[/size]{newPos} ([b][color={diffColor}]{diffPos}[/color][/b])",rankNoDiff:" [size=small]{rank}[/size]{newPos} ([b][color={remainsColor}]{remainsNo}[/color][/b])",rankLineNoDiff:"\n[color={diffColor}]{position} {diff} [/color][color={nameColor}][b]{name}[/b][/color] - {oldScore} ([b][color={remainsColor}]{remainsNo}[/color][/b])",from0Member:"\n[color={growsColor}]{grows} [/color] [color={nameColor}][b]{name}[/b][/color] - [b][color={growsColor}]{score}[/color][/b] [size=small]({reason})[/size]",to0Member:"\n[color={decreasesColor}]{decreases} [/color] [color={nameColor}][b]{name}[/b][/color] - [b][color={decreasesColor}]{score}[/color][/b] [size=small]({reason})[/size]",scriptData:"\n[i]{scriptDataTitle}:[/i]\n[spoiler][code]{scriptData}[/code][/spoiler]",scriptLink:"\n[i]"+F("o_abt").replace("{link}","[url={scriptHome}]{scriptName}[/url]")+"[/i]"}};p.prototype={add:function(G,H){this.formats.push({name:G,patterns:H,escapeMap:(arguments.length>2)?arguments[2]:false})},select:function(G){this.selected=this.formats[G]},escape:function(G){if(this.selected.escapeMap){return G.replaceMap(this.selected.escapeMap)}else{return G.replaceMap(this.escapeMap)}},diff:function(H,I){var G=H;if(I<0){G=G.replaceMap({"{diffColor}":"{decreasesColor}","{diff}":"{decreases}"})}else{if(I>0){G=G.replaceMap({"{diffColor}":"{growsColor}","{diff}":"{grows}"})}else{G=G.replaceMap({"{diffColor}":"{remainsColor}","{diff}":"{remains}"})}}return G},header:function(G){return this.layout.header.replaceMap({"{title}":F("o_tdt").replaceMap({"{oldDate}":this.layout.dateTime.replaceMap({"{date}":G.oldDate,"{time}":G.oldTime}),"{newDate}":this.layout.dateTime.replaceMap({"{date}":G.newDate,"{time}":G.newTime})}),"{elapsedTitle}":F("o_tet"),"{elapsedTime}":this.escape(w.period(G.newTimestamp-G.oldTimestamp))})},alliance:function(G){if(G.oldScore==0){return""}return this.layout.sectionStart.replaceAll("{title}",F("o_tas"))+this.diff(this.layout.allianceLine,G.diffScore).replaceMap({"{title}":F("o_ptl"),"{newScore}":G.formatted.newScore,"{diffScore}":G.formatted.diffScore,"{diffPercent}":G.formatted.diffPercent})+this.diff(this.layout.allianceLine,G.diffMemberScore).replaceMap({"{title}":F("o_ppm"),"{newScore}":G.formatted.newMemberScore,"{diffScore}":G.formatted.diffMemberScore,"{diffPercent}":G.formatted.diffMemberPercent})+this.layout.sectionEnd},position:function(L,G){var H=L+"",K=(H).length,J=(G+"").length;for(var I=K;I<J;I++){H="0"+H}return H},top3:function(J,L,N,G){var I=(this.layout.sectionStart+"").replace("{title}",N);var H=Math.min(J.length,3);var K,M;for(K=0;K<H;K++){M=J[K];I=I+this.diff(G,M.diffScore).replaceMap({"{position}":this.position(K+1,H),"{name}":this.escape(M.name),"{diffPos}":M.formatted.diffPos.replaceMap({"+":"{up}","-":"{down}"})}).replaceAll("{"+L+"}",M.formatted[L])}return I+this.layout.sectionEnd},rank:function(I,M){var H=(this.layout.sectionStart+"").replace("{title}",M);var G=I.length;var J,L;for(J=0;J<G;J++){L=I[J];var K=(L.diffScore==0)?this.layout.rankLineNoDiff:this.layout.rankLine;H=H+this.diff(K,L.diffScore).replaceMap({"{position}":this.position(J+1,G),"{name}":this.escape(L.name),"{oldScore}":L.formatted.oldScore,"{newScore}":L.formatted.newScore,"{diffScore}":L.formatted.diffScore,"{diffPercent}":L.formatted.diffPercent});K=(L.diffPos==0)?this.layout.rankNoDiff:this.layout.rank;H=H+this.diff(K,L.diffPos).replaceMap({"{newPos}":L.formatted.newPos,"{diffPos}":L.formatted.diffPos.replaceMap({"+":"{up}","-":"{down}"})})}return H+this.layout.sectionEnd},specialCases:function(I,J){if((I.length+J.length)==0){return""}var G=this.layout.sectionStart.replace("{title}",F("o_tsc"));var H,K;for(H in J){K=J[H];G=G+this.layout.from0Member.replaceMap({"{name}":this.escape(K.name),"{score}":K.score,"{reason}":K.reason})}for(H in I){K=I[H];G=G+this.layout.to0Member.replaceMap({"{name}":this.escape(K.name),"{score}":K.score,"{reason}":K.reason})}return G+this.layout.sectionEnd},format:function(I,L,R,N,Q,O,W){var K=this.header(L);if(I.alliance){K=K+this.alliance(L)}var P="";var J="";var S="";var V="";var H="";var G="";var T="";var U="";if(R.length>0){R=R.sort(function(Y,X){if(Y.newScore==X.newScore){return(Y.diffScore>=X.diffScore)?-1:1}else{return(Y.newScore>=X.newScore)?-1:1}});if(I.top3TScore&&(R.length>5||!I.tScore)){J=this.top3(R,"newScore",F("o_ttt"),this.layout.top3TScoreLine)}if(I.tScore){H=this.rank(R,F("o_trt"))}R=R.sort(function(Y,X){if(Y.diffScore==X.diffScore){if(Y.diffPercent==X.diffPercent){return(Y.newScore>=X.newScore)?-1:1}else{return(Y.diffPercent>=X.diffPercent)?-1:1}}else{return(Y.diffScore>=X.diffScore)?-1:1}});if(I.top3Score&&(R.length>5||!I.score)){P=this.top3(R,"diffScore",F("o_tts"),this.layout.top3ScoreLine)}if(I.score){G=this.rank(R,F("o_trs"))}R=R.sort(function(Y,X){if(Y.diffPercent==X.diffPercent){if(Y.diffScore==X.diffScore){return(Y.newScore>=X.newScore)?-1:1}else{return(Y.diffScore>=X.diffScore)?-1:1}}else{return(Y.diffPercent>=X.diffPercent)?-1:1}});if(I.top3Percent&&(R.length>5||!I.percent)){S=this.top3(R,"diffPercent",F("o_ttp"),this.layout.top3PercentLine)}if(I.percent){T=this.rank(R,F("o_trp"))}R=R.sort(function(Y,X){if(Y.diffPos==X.diffPos){if(Y.diffScore==X.diffScore){if(Y.diffPercent==X.diffPercent){return(Y.newScore>=X.newScore)?-1:1}else{return(Y.diffPercent>=X.diffPercent)?-1:1}}else{return(Y.diffScore>=X.diffScore)?-1:1}}else{return(Y.diffPos>=X.diffPos)?-1:1}});if(I.top3Positions&&(R.length>5||!I.positions)){V=this.top3(R,"diffPos",F("o_ttg"),this.layout.top3PositionsLine)}if(I.positions){U=this.rank(R,F("o_trg"))}}K=K+J+P+S+V+H+G+T+U;if(I.special){K=K+this.specialCases(N,Q)}var M;if(I.oldData){M=JSON.parse(O);K=K+this.layout.scriptData.replaceMap({"{scriptDataTitle}":F("t_odt")+" - "+M.strDate+" ("+M.strTime+")","{scriptData}":"{oldData}"})}if(I.newData){M=JSON.parse(W);K=K+this.layout.scriptData.replaceMap({"{scriptDataTitle}":F("t_ndt")+" - "+M.strDate+" ("+M.strTime+")","{scriptData}":"{newData}"})}K=K+this.layout.scriptLink;K=K.replaceMap(this.selected.patterns).replaceMap(u.selected).replaceMap({"{scriptName}":i.name,"{scriptHome}":i.home}).replaceMap(this.lastReplace).replace("{oldData}",O.replaceMap({"<":"\\u003C",">":"\\u003E","[":"\\u005B","]":"\\u005D"})).replace("{newData}",W.replaceMap({"<":"\\u003C",">":"\\u003E","[":"\\u005B","]":"\\u005D"}));return K.trim()}};var z=new p();z.add("phpBB",{"[size=big]":"[size=20]","[size=small]":"[size=10]"});z.add("phpBB3",{"[size=big]":"[size=140]","[size=small]":"[size=80]"});z.add("SMF",{"[size=big]":"[size=14pt]","[size=small]":"[size=7pt]"});z.add("vBulletin",{"[size=big]":"[size=4]","[size=small]":"[size=1]"});z.add("HTML",{"{grows}":"&raquo;","{decreases}":"&laquo;","{remains}":"&sim;","{remainsNo}":"&Oslash;","{up}":"&uarr;","{down}":"&darr;","{infinity}":"&#8734;","[size=big]":'<span style="font-size: 140%;">',"[size=small]":'<span style="font-size: 80%;">',"[/size]":"</span>","[color={":'<span style="color: {',"Color}]":'Color}">',"[/color]":"</span>","[b]":"<b>","[/b]":"</b>","[i]":"<i>","[/i]":"</i>","\n":"<br />\n","[spoiler]":"<div>","[/spoiler]":"</div>","[code]":'<textarea onclick="this.select();" rows="5" cols="20">',"[/code]":"</textarea>","[url={scriptHome}]{scriptName}[/url]":'<a href="{scriptHome}">{scriptName}</a>'},{"&":"&amp;","<":"&lt;",">":"&gt;"});var B=function(){};B.prototype={reset:function(){this.allyInfo={oldCount:0,oldScore:0,newCount:0,newScore:0};this.membersInfo=new Array();this.oldMembersInfo=new Array();this.newMembersInfo=new Array();this.to0MembersInfo=new Array();this.from0MembersInfo=new Array()},readData:function(J,I){var G,H=JSON.parse(J);this.allyInfo[I+"Timestamp"]=H.timestamp;this.allyInfo[I+"Date"]=H.strDate;this.allyInfo[I+"Time"]=H.strTime;for(G in H.members){this[I+"MembersInfo"].push({id:("i" in H.members[G])?H.members[G].i:-1,name:G,score:H.members[G].s,pos:H.members[G].p,coord:H.members[G].c,date:H.members[G].d,noPartner:true});this.allyInfo[I+"Count"]++;this.allyInfo[I+"Score"]=this.allyInfo[I+"Score"]+H.members[G].s}return H},merge:function(){var O,M,S,L,N,I,P;S=this.allyInfo.oldCount;for(O in this.newMembersInfo){N=this.newMembersInfo[O];for(M=0;M<S;M++){L=this.oldMembersInfo[M];if((L.noPartner)&&(L.id==N.id)){break}}if(M!=S){this.oldMembersInfo[M].noPartner=false;this.newMembersInfo[O].noPartner=false;if(N.pos==0){this.to0MembersInfo.push({name:N.name,score:w.number(L.score),reason:F("o_bdg")})}else{if(L.pos==0){this.from0MembersInfo.push({name:N.name,score:w.number(N.score),reason:F("o_bdq")})}else{var G,H,K,R;if(L.score==0){if(N.score==0){G=0;H=0;K="+0";R="+"+w.number("0.00")}else{G=N.score;H=(1/0);K="+"+w.number(N.score);R="+{infinity}"}}else{if(N.score==0){G=(-1)*L.score;H=(-100);K=w.number(G);R=w.number("-100.00")}else{P=r.diffScore(L.score,N.score);G=P.score;H=P.percent;K=((G<0)?"":"+")+w.number(G.toFixed());R=((H<0)?"":"+")+w.number(H.toFixed(2))}}I={name:N.name,oldScore:L.score,newScore:N.score,oldPos:L.pos,newPos:N.pos,diffPos:L.pos-N.pos,diffScore:G,diffPercent:H};I.formatted={oldScore:w.number(I.oldScore),newScore:w.number(I.newScore),oldPos:w.number(I.oldPos.toFixed()),newPos:w.number(I.newPos.toFixed()),diffPos:((I.diffPos<0)?"":"+")+w.number(I.diffPos.toFixed()),diffScore:K,diffPercent:R};this.membersInfo.push(I)}}}}var J,Q;for(Q in this.newMembersInfo){J=this.newMembersInfo[Q];if(J.noPartner){this.from0MembersInfo.push({name:J.name,score:w.number(J.score),reason:F("o_cnm")})}}for(Q in this.oldMembersInfo){J=this.oldMembersInfo[Q];if(J.noPartner){this.to0MembersInfo.push({name:J.name,score:w.number(J.score),reason:F("o_cla")})}}this.to0MembersInfo.sort(function(U,T){return parseInt(U.score)-parseInt(T.score)});this.from0MembersInfo.sort(function(U,T){return parseInt(T.score)-parseInt(U.score)});delete this.oldMembersInfo;delete this.newMembersInfo;P=r.diffScore(this.allyInfo.oldScore,this.allyInfo.newScore);this.allyInfo.diffScore=P.score;this.allyInfo.diffPercent=P.percent;this.allyInfo.oldMemberScore=this.allyInfo.oldScore/this.allyInfo.oldCount;this.allyInfo.newMemberScore=this.allyInfo.newScore/this.allyInfo.newCount;P=r.diffScore(this.allyInfo.oldMemberScore,this.allyInfo.newMemberScore);this.allyInfo.diffMemberScore=P.score;this.allyInfo.diffMemberPercent=P.percent;this.allyInfo.formatted={oldScore:w.number(this.allyInfo.oldScore),newScore:w.number(this.allyInfo.newScore),diffScore:((this.allyInfo.diffScore<0)?"":"+")+w.number(this.allyInfo.diffScore.toFixed()),diffPercent:((this.allyInfo.diffPercent<0)?"":"+")+w.number(this.allyInfo.diffPercent.toFixed(2)),oldMemberScore:w.number(this.allyInfo.oldMemberScore.toFixed()),newMemberScore:w.number(this.allyInfo.newMemberScore.toFixed()),diffMemberScore:((this.allyInfo.diffMemberScore<0)?"":"+")+w.number(this.allyInfo.diffMemberScore.toFixed()),diffMemberPercent:((this.allyInfo.diffMemberPercent<0)?"":"+")+w.number(this.allyInfo.diffMemberPercent.toFixed(2))}},doIt:function(K){K.setStats();K.setPreview();z.select(parseInt(K.selectFormat.selectedIndex));u.select(parseInt(K.selectColors.selectedIndex));K.setOkStatus(F("w_pcs")+"...");this.reset();var L,N,J=false;if(K.oldList.value.trim()==""){K.setErrorStatus(F("e_nod"));K.setTitle("old",F("e_ndt"),false);J=true}if(!J){try{L=this.readData(K.oldList.value,"old");N=L.strDate+" (<i>"+L.strTime+"</i>) &rarr; "+((t.timestamp==L.timestamp)?F("p_now"):F("p_ago").replace("{period}",w.period(t.timestamp-L.timestamp)));if(this.oldMembersInfo.length==0||/NaN|undefined/.test(N)){throw 0}K.setTitle("old",N,true)}catch(M){K.setTitle("old",F("e_wft"),false);K.setErrorStatus(F("e_odf"));J=true}}if(K.newList.value.trim()==""){K.setErrorStatus(F("e_nnd"));K.setTitle("new",F("e_ndt"),false);return}try{L=this.readData(K.newList.value,"new");N=L.strDate+" (<i>"+L.strTime+"</i>) &rarr; "+((t.timestamp==L.timestamp)?F("p_now"):F("p_ago").replace("{period}",w.period(t.timestamp-L.timestamp)));if(this.newMembersInfo.length==0||/NaN|undefined/.test(N)){throw 0}K.setTitle("new",N,true);if(J){return}}catch(M){K.setErrorStatus(F("e_ndf"));return}try{this.merge();var G={alliance:K.doAlliance.checked,top3TScore:K.doTop3TScore.checked,top3Score:K.doTop3Score.checked,top3Percent:K.doTop3Percent.checked,top3Positions:K.doTop3Positions.checked,tScore:K.doTScore.checked,score:K.doScore.checked,percent:K.doPercent.checked,positions:K.doPositions.checked,special:K.doSpecial.checked,oldData:K.doOldData.checked,newData:K.doNewData.checked};K.setStats(z.format(G,this.allyInfo,this.membersInfo,this.to0MembersInfo,this.from0MembersInfo,K.oldList.value.trim(),K.newList.value.trim()));G.oldData=false;G.newData=false;z.select(z.formats.length-1);u.select(0);var I="[color={nameColor}][b]{name}[/b][/color]".replaceMap(z.selected.patterns).replaceAll("{name}",t.player_name);var H=I.replaceAll("{nameColor}","#FF0");I=I.replaceMap(u.selected);K.setPreview(z.format(G,this.allyInfo,this.membersInfo,this.to0MembersInfo,this.from0MembersInfo,K.oldList.value.trim(),K.newList.value.trim()).replaceAll(z.selected.patterns["[size=small]"],"<span>").replaceAll(z.selected.patterns["[size=big]"],'<span style="font-size:20px">').replaceAll(I,H));K.hideStatus()}catch(M){K.setErrorStatus(F("e_unk")+": "+M)}}};var y=new B();var e={num:(new Date()).getTime(),get:function(){return i.name+(this.num++)}};var o=function(){};o.prototype={addTextarea:function(H){var G=l.createElement("textarea");G.setAttribute("cols","120");G.setAttribute("rows","40");G.setAttribute("class","textBox");H.appendChild(G);return G},addSelect:function(H){var G=l.createElement("select");G.setAttribute("class","dropdown");H.appendChild(G);return G},addOption:function(J,I,H){var G=l.createElement("option");G.appendChild(l.createTextNode(J));G.setAttribute("value",I);H.appendChild(G);return G},addAnchor:function(H,I){var G=l.createElement("a");G.setAttribute("href","javascript:void(0);");G.setAttribute("class",i.name);G.appendChild(l.createTextNode(I));H.appendChild(G);return G},addTitle:function(H,I){var G=l.createElement("b");G.appendChild(l.createTextNode(I));G.setAttribute("style","display:block;font-size:12px");H.appendChild(G);return G},newCell:function(){var G=l.createElement("td");return G},addText:function(H,I){var G=l.createTextNode(I);H.appendChild(G);return G},addBr:function(G){G.appendChild(l.createElement("br"))},addEvent:function(I,H,G){I.addEventListener(H,G,false)},addOnChange:function(H,G){H.addEventListener("change",G,false);H.addEventListener("keyup",G,false)},cancelBubble:function(H){var G=H?H:f.event;if(G.stopPropagation){G.stopPropagation()}if(G.cancelBubble!=null){G.cancelBubble=true}},addCheckbox:function(I,M,N,L,K){var G=l.createElement("input");G.setAttribute("type","checkbox");G.setAttribute("id",i.name+"_"+N);G.setAttribute("style","cursor:pointer;");I.appendChild(G);var H=l.createElement("label");H.setAttribute("for",i.name+"_"+N);H.setAttribute("style","cursor:pointer;");H.innerHTML="&nbsp;"+M;I.appendChild(H);this.addBr(I);var J=C.get(N);G.checked=(J==null)?L:(parseInt(J)==1);C.set(N,(G.checked)?1:0);G.addEventListener("change",function(){C.set(N,(G.checked)?1:0);K()},false);H.addEventListener("mouseover",function(){H.setAttribute("class","undermark")},false);H.addEventListener("mouseout",function(){H.removeAttribute("class")},false);return G},makeTogleable:function(N,R,O,J){var P=l.createElement("a");P.setAttribute("class",i.name+"_toggle_button");var K=J;var I=(N.length)?N:new Array(N);var G=true;var M=function(){G=true;for(var S in I){I[S].removeAttribute("style")}O.setAttribute("class",O.getAttribute("class").replace("_toggle_bar_open","_toggle_bar_close"))};var Q=function(){G=false;for(var S in I){I[S].setAttribute("style","display:none;")}O.setAttribute("class",O.getAttribute("class").replace("_toggle_bar_close","_toggle_bar_open"))};var L=function(){if(G){Q()}else{M()}};if(K){var H=e.get();P.setAttribute("href","#"+H);P.setAttribute("id",H)}else{P.setAttribute("href","javascript:void(0);")}P.addEventListener("click",function(S){A.cancelBubble(S);L()},false);O.setAttribute("class",O.hasAttribute("class")?O.getAttribute("class")+" "+i.name+"_toggle_bar_close":i.name+"_toggle_bar_close");O.addEventListener("click",function(S){P.click()},false);L();R.setAttribute("style","position:relative;");R.appendChild(P);return{open:M,close:Q,toggle:L}},addCss:g,ogameDropDown:function(O){var L,K,I=d(".dropdown.dropdownList").get(),J,M,G,H,P;try{O.ogameDropDown()}catch(N){O.css("visibility","visible");return false}P={select:O};H=function(){var R,Q;R=P.select.val();Q=P.select.find('[value="'+R+'"]').text();P.dropdown.attr("data-value",R).text(Q)};J=d(".dropdown.dropdownList").get();for(L=0;L<I.length;L++){I[L]=d(I[L])}for(L=0;L<J.length;L++){J[L]=d(J[L]);G=J[L].attr("id");M=true;for(K=0;K<I.length;K++){if(I[K].attr("id")==G){M=false;break}}if(M){P.dropdown=d('.dropdown [rel="'+G+'"]');H();O.change(H);break}}return true}};var A=new o();
/*! [css] */
;A.addCss("#"+i.name+" table{width: 610px !important;}#"+i.name+" textarea{width: 350px !important;height: 70px !important;margin: 0 !important;padding: 5px !important;}#"+i.name+" a."+i.name+"{display: block !important;padding: 5px 0 0 0 !important;}#"+i.name+" select{width: 250px !important;}#"+i.name+" td{border-top: 2px dotted #242E38 !important;padding: 5px !important;text-align: left !important;}tr.alt #"+i.name+" td{border-top: 2px dotted #24292E !important;}#"+i.name+" td.col2{width: 364px !important;}#"+i.name+" tr.tit td{border-top: none !important;line-height: 18px !important;}td#"+i.name+"_preview{border-top: 2px dotted #242E38 !important;color: #6F9FC8 !important;}#"+i.name+"_preview div{padding-top: 5px !important;padding-bottom: 5px !important;}#"+i.name+"_preview a{display: inline !important;padding: 0 !important;}."+i.name+"_toggle_button{background-color: transparent !important;background-image: url('http://gf2.geo.gfsrv.net/cdn71/fc7a8ede3499a0b19ea17613ff0cb1.gif') !important;display  : block !important;position : absolute !important;top      : 0 !important;right    : 0 !important;height   : 18px !important;width    : 20px !important;}."+i.name+"_toggle_bar_open,."+i.name+"_toggle_bar_close{cursor: pointer !important;}."+i.name+"_toggle_bar_open ."+i.name+"_toggle_button{background-position: 0 0 !important;}."+i.name+"_toggle_bar_close ."+i.name+"_toggle_button{background-position: 0 -18px !important;}."+i.name+"_toggle_bar_open:hover ."+i.name+"_toggle_button{background-position: -20px 0 !important;}."+i.name+"_toggle_bar_close:hover ."+i.name+"_toggle_button{background-position: -20px -18px !important;}");
/*! [/css] */
;var s=function(S){var J,O,H,R,K,T,L,M,I,P,N,G;K=this;M=function(){K.doIt()};var Q=/WebKit|Gecko|Presto/i.test(f.navigator.userAgent);this.table=l.createElement("table");this.table.setAttribute("cellpadding","0");this.table.setAttribute("cellspacing","0");this.table.setAttribute("class","members bborder");S.appendChild(this.table);J=l.createElement("tbody");this.table.appendChild(J);O=l.createElement("tr");O.setAttribute("class","tit alt");J.appendChild(O);H=A.newCell();H.setAttribute("colspan","2");H.setAttribute("class","col2");P=l.createElement("div");A.addTitle(P,F("t_inc")+":");H.appendChild(P);O.appendChild(H);N=O;O=l.createElement("tr");O.setAttribute("class","alt");J.appendChild(O);O.appendChild(A.newCell());H=A.newCell();H.setAttribute("class","col2");this.doAlliance=A.addCheckbox(H,F("o_tas"),"doAlliance",true,M);this.doTop3TScore=A.addCheckbox(H,F("o_ttt"),"doTop3TScore",false,M);this.doTop3Score=A.addCheckbox(H,F("o_tts"),"doTop3Score",false,M);this.doTop3Percent=A.addCheckbox(H,F("o_ttp"),"doTop3Percent",false,M);this.doTop3Positions=A.addCheckbox(H,F("o_ttg"),"doTop3Positions",false,M);this.doTScore=A.addCheckbox(H,F("o_trt"),"doTScore",false,M);this.doScore=A.addCheckbox(H,F("o_trs"),"doScore",true,M);this.doPercent=A.addCheckbox(H,F("o_trp"),"doPercent",true,M);this.doPositions=A.addCheckbox(H,F("o_trg"),"doPositions",false,M);this.doSpecial=A.addCheckbox(H,F("o_tsc"),"doSpecial",true,M);this.doOldData=A.addCheckbox(H,"[spoiler] "+F("t_odt"),"doOldData",false,M);this.doNewData=A.addCheckbox(H,"[spoiler] "+F("t_ndt"),"doNewData",true,M);O.appendChild(H);if(Q){A.makeTogleable(O,P,N,false)}O=l.createElement("tr");O.setAttribute("class","tit");J.appendChild(O);H=A.newCell();H.setAttribute("colspan","2");H.setAttribute("class","col2");P=l.createElement("div");A.addTitle(P,F("t_pre")+":");H.appendChild(P);O.appendChild(H);N=O;O=l.createElement("tr");J.appendChild(O);H=A.newCell();H.setAttribute("colspan","2");H.setAttribute("id",i.name+"_preview");O.appendChild(H);if(Q){A.makeTogleable(O,P,N,false).open()}H.appendChild(this.preview=l.createElement("div"));this.previewRow=O;this.setPreview();O=l.createElement("tr");O.setAttribute("class","alt tit");J.appendChild(O);H=A.newCell();A.addTitle(H,F("t_odt")+":");O.appendChild(H);H=A.newCell();H.setAttribute("class","col2");P=l.createElement("div");this.oldTitle=l.createElement("span");P.appendChild(this.oldTitle);H.appendChild(P);O.appendChild(H);N=O;O=l.createElement("tr");O.setAttribute("class","alt");J.appendChild(O);H=A.newCell();R=A.addAnchor(H,F("b_sel"));R.addEventListener("click",function(){K.oldList.select()},false);R=A.addAnchor(H,F("b_del"));R.addEventListener("click",function(){K.setOldList()},false);R=A.addAnchor(H,F("b_loa"));R.addEventListener("click",function(){K.load()},false);R=A.addAnchor(H,F("b_sav"));R.addEventListener("click",function(){K.save("old")},false);O.appendChild(H);H=A.newCell();H.setAttribute("class","col2");this.oldList=A.addTextarea(H);A.addOnChange(this.oldList,M,false);O.appendChild(H);if(Q){A.makeTogleable(O,P,N,true)}O=l.createElement("tr");O.setAttribute("class","tit");J.appendChild(O);H=A.newCell();A.addTitle(H,F("t_ndt")+":");O.appendChild(H);H=A.newCell();H.setAttribute("class","col2");P=l.createElement("div");this.newTitle=l.createElement("span");P.appendChild(this.newTitle);H.appendChild(P);O.appendChild(H);N=O;O=l.createElement("tr");J.appendChild(O);H=A.newCell();R=A.addAnchor(H,F("b_sel"));R.addEventListener("click",function(){K.newList.select()},false);R=A.addAnchor(H,F("b_del"));R.addEventListener("click",function(){K.setNewList()},false);R=A.addAnchor(H,F("b_get"));R.addEventListener("click",function(){K.setNewListFromPage()},false);R=A.addAnchor(H,F("b_sav"));R.addEventListener("click",function(){K.save("new")},false);R.setAttribute("title",F("b_svt"));O.appendChild(H);H=A.newCell();H.setAttribute("class","col2");this.newList=A.addTextarea(H);A.addOnChange(this.newList,M,false);O.appendChild(H);if(Q){A.makeTogleable(O,P,N,true)}O=l.createElement("tr");O.setAttribute("class","tit alt");J.appendChild(O);H=A.newCell();H.setAttribute("colspan","2");H.setAttribute("class","col2");P=l.createElement("div");A.addTitle(P,F("t_exp")+":");H.appendChild(P);O.appendChild(H);N=O;I=new Array();O=l.createElement("tr");O.setAttribute("class","alt");J.appendChild(O);H=A.newCell();A.addText(H,F("t_fmt")+":");O.appendChild(H);H=A.newCell();H.setAttribute("class","col2");this.selectFormat=A.addSelect(H);for(T in z.formats){A.addOption(z.formats[T].name,T,this.selectFormat)}L=C.get("selectFormat");this.selectFormat.selectedIndex=(L==null)?0:parseInt(L);d(this.selectFormat).change(function(){C.set("selectFormat",K.selectFormat.selectedIndex+"");M()});O.appendChild(H);I.push(O);A.ogameDropDown(d(this.selectFormat));O=l.createElement("tr");O.setAttribute("class","alt");J.appendChild(O);H=A.newCell();A.addText(H,F("t_col")+":");O.appendChild(H);H=A.newCell();H.setAttribute("class","col2");this.selectColors=A.addSelect(H);for(T in u.names){A.addOption(u.names[T],T,this.selectColors)}L=C.get("selectColors");this.selectColors.selectedIndex=(L==null)?0:parseInt(L);d(this.selectColors).change(function(){C.set("selectColors",K.selectColors.selectedIndex+"");M()});O.appendChild(H);I.push(O);A.ogameDropDown(d(this.selectColors));O=l.createElement("tr");O.setAttribute("class","alt");J.appendChild(O);H=A.newCell();A.addText(H,F("t_out")+":");R=A.addAnchor(H,F("b_sel"));R.addEventListener("click",function(){K.stats.select()},false);O.appendChild(H);H=A.newCell();H.setAttribute("class","col2");this.stats=A.addTextarea(H);this.stats.setAttribute("readonly","readonly");this.stats.addEventListener("click",function(){K.stats.select()},false);O.appendChild(H);I.push(O);if(Q){A.makeTogleable(I,P,N,true)}O=l.createElement("tr");O.setAttribute("class","tit");J.appendChild(O);H=A.newCell();H.setAttribute("class","col2");H.setAttribute("align","right");H.setAttribute("colspan","2");O.appendChild(H);R=A.addAnchor(H,F("b_res"));R.setAttribute("class","action btn_blue float_right");R.addEventListener("click",function(){K.resetData()},false);this.statusRow=(O=l.createElement("tr"));O.setAttribute("class","alt tit");J.appendChild(O);H=A.newCell();A.addTitle(H,F("t_stb")+":");O.appendChild(H);this.statusLine=(H=A.newCell());H.setAttribute("class","col2");this.statusText=A.addText(H,"");O.appendChild(H);this.hideStatus()};s.prototype={load:function(){this.setOldList(C.get("oldData"))},save:function(G){C.set("oldData",this[G+"List"].value)},setOldList:function(G){if(arguments.length>0){this.oldList.value=G}else{this.oldList.value=""}this.doIt()},setNewList:function(G){if(arguments.length>0){this.newList.value=G}else{this.newList.value=""}this.doIt()},resetData:function(){this.setNewListFromPage();this.setOldList(this.currentPageData);C.set("oldData",this.currentPageData)},setStats:function(G){if(arguments.length>0){this.stats.value=G}else{this.stats.value=""}},setPreview:function(G){if(arguments.length>0){this.preview.innerHTML=G}else{this.preview.innerHTML=""}},setNewListFromPage:function(){if(this.currentPageData){this.setNewList(this.currentPageData);return}var L=l.getElementById("OGameClock");if(L==null){L=l.querySelector("li.OGameClock")}var O={timestamp:t.timestamp,strDate:w.date(L.innerHTML.split("<")[0]),strTime:w.time(L.getElementsByTagName("span")[0].innerHTML),members:{}};var T=b.list.getElementsByTagName("tbody")[0].getElementsByTagName("tr");for(var Q=0;Q<T.length;Q++){var P=T[Q].getElementsByTagName("td");var M=P[0].innerHTML.trim();var N;var H=P[2].getElementsByTagName("select");if(H.length>0){N=H[0].options[H[0].selectedIndex].innerHTML}else{N=P[2].innerHTML}N=N.trim();var K=P[3].getElementsByTagName("span");if(K.length>0){K=K[0]}else{K=P[3]}var R=K.getElementsByTagName("a")[0];K=K.getAttribute("title");K=parseInt(K.replace(/\D/gi,""));var G=R.getAttribute("href");G=parseInt(G.replace(/^.*searchRelId\=(\d+)(\D.*)?$/,"$1"));R=parseInt(R.innerHTML.replace(/\D/gi,""));var S=P[4].getElementsByTagName("a")[0].innerHTML;S=S.replace(/[^\d\:]/gi,"");var J=w.date(P[5].innerHTML);O.members[M]={i:G,r:N,s:K,p:R,c:S,d:J};var I=O.members[M];if(/NaN|undefined|null/.test(I.i+"")||(I.r)==null||typeof I.r=="undefined"||/NaN|undefined|null/.test(I.s+"")||/NaN|undefined|null/.test(I.p+"")||(!(/^\d+\:\d+\:\d+$/.test(I.c+"")))||(I.d)==null||typeof I.r=="undefined"){return false}}this.currentPageData=JSON.stringify(O);this.setNewList(this.currentPageData);return true},hideStatus:function(){this.statusRow.setAttribute("style","display:none")},showStatus:function(){this.statusRow.setAttribute("style","")},setErrorStatus:function(G){this.statusText.nodeValue="";this.statusLine.setAttribute("class","overmark");if(arguments.length>0){this.statusText.nodeValue=G}this.showStatus()},setOkStatus:function(G){this.statusText.nodeValue="";this.statusLine.setAttribute("class","undermark");if(arguments.length>0){this.statusText.nodeValue=G}this.showStatus()},setTitle:function(I,G,H){this[I+"Title"].setAttribute("class",(H)?"undermark":"overmark");this[I+"Title"].innerHTML=G},doIt:function(){y.doIt(this)}};var D=function(I){var K=this;this.section=l.createElement("div");this.section.setAttribute("class","section");var G=l.createElement("h3");var H=l.createElement("span");this.button=l.createElement("a");this.button.setAttribute("class","closed");this.button.setAttribute("href","javascript:void(0);");this.button.addEventListener("click",function(){K.toggle()},false);A.addText(H,i.name);this.button.appendChild(H);G.appendChild(this.button);this.section.appendChild(G);I.appendChild(this.section);this.sectioncontent=l.createElement("div");this.sectioncontent.setAttribute("class","sectioncontent");this.sectioncontent.setAttribute("id",i.name);this.sectioncontent.setAttribute("style","display:none;");this.content=l.createElement("div");this.content.setAttribute("class","contentz");var J=l.createElement("div");J.setAttribute("class","footer");this.sectioncontent.appendChild(this.content);this.sectioncontent.appendChild(J);I.appendChild(this.sectioncontent);this.form=null;this.canLoad=true;this.wTime=30;this.toggleTimer=null};var q=function(I){var G=0,H=0;if(I.offsetParent){do{G+=I.offsetLeft;H+=I.offsetTop}while(I=I.offsetParent)}return{l:G,t:H}};D.prototype={loadForm:function(){this.canLoad=false;if(!b.ready){this.wTime=Math.round(this.wTime*1.1);var G=this;setTimeout(function(){G.loadForm()},this.wTime);return}this.form=new s(this.content);this.form.setErrorStatus(F("e_nod"));if(!this.form.setNewListFromPage()){this.sectioncontent.innerHTML='<div style="color:red;text-align:center;font-weigth:bold;padding:30px">'+F("e_oga")+"</div>"}this.form.load();if(this.form.oldList.value==""){this.form.save("new");this.form.load()}},toggle:function(){if(this.canLoad){this.loadForm()}if(this.button.getAttribute("class")=="closed"){this.button.setAttribute("class","opened");this.sectioncontent.setAttribute("style","display:block;");var H=q(this.section);for(var G=10;G<=100;G+=30){setTimeout(function(){try{f.scroll(H.l,H.t)}catch(I){}},G)}}else{this.button.setAttribute("class","closed");this.sectioncontent.setAttribute("style","display:none;")}}};i.domWait=30;i.domLoader=function(){clearTimeout(this.domTimer);if(l.getElementById("allyInternText")){delete this.dom;this.dom=new D(l.getElementById("eins"))}else{this.domWait=Math.round(this.domWait*1.1);this.domTimer=setTimeout(function(){i.domLoader()},this.domWait)}};i.init=function(){this.domLoader();try{l.querySelector("a.navi.overview").addEventListener("click",function(){i.domWait=30;i.domLoader()},false);var G=l.querySelector("#form_assignRank a.save_bigger");if(G){G.addEventListener("click",function(){i.domWait=30;i.domTimer=setTimeout(function(){i.domLoader()},500)},false)}}catch(H){}};i.init()};var k=function(){try{d=f.jQuery;if(typeof(d)=="undefined"){throw 0}if(typeof(d.fn.ogameDropDown)=="undefined"){throw 0}a()}catch(o){setTimeout(k,50)}};
/*! [onDOMContentLoaded] by Dean Edwards & Matthias Miller & John Resig */
;var j=false,n=function(){if(j){return}j=true;if(c){clearInterval(c)}k()};if(l.addEventListener){l.addEventListener("DOMContentLoaded",n,false)}if(/WebKit/i.test(f.navigator.userAgent)){var c=setInterval(function(){if(/loaded|complete/.test(l.readyState)){n()}},10)}f.onload=n})();